package test0309;

import java.util.Scanner;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * 打印金字塔
 *     1
 *  1  2  1
 */
@SuppressWarnings({"all"})
public class Main {

    public static void main(String[] args) {
        try (Scanner scanner = new Scanner(System.in)) {
            int N = scanner.nextInt(); // 控制指数边界
            int spaceCount = N; // 控制空格数量
            for (int i = 0; i <= N; i++) {
                int num = (int) Math.pow(2, i);
                printEachLine(num, spaceCount);
                spaceCount--;
            }
        }
    }

    // num 控制中间的数字, count 控制空格数量， 用于打印每一行
    private static void printEachLine(int num, int count){
        // 打印左边的空格
        while (count-- != 0){
            System.out.print(" \t");
        }
        // 打印数字
        int curNum = 1;
        while (curNum <= num){
            System.out.print(curNum + "\t");
            curNum *= 2;
        }
        curNum /= 2;
        while (curNum > 1){
            curNum /= 2;
            System.out.print(curNum + "\t");
        }
        System.out.println();
    }
}
